package cn.itsource.basic.util;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.http.HttpUtil;
import org.springframework.stereotype.Component;

/**
 * 短信服务
 */
@Component
public class ShortMessageService {

    public static void main(String[] args) {
        System.out.println(RandomUtil.randomNumbers(4));
        System.out.println(RandomUtil.randomNumbers(4));
        System.out.println(RandomUtil.randomNumbers(4));
        System.out.println(RandomUtil.randomNumbers(4));
        System.out.println(RandomUtil.randomNumbers(4));
    }

    /**
     * 发送短信
     *
     短信接口接入请参阅文档 http://www.smschinese.cn/api.shtml
     */
    public void sendPhoneMessage(String phoneNumber, String smsText) {
        HttpUtil.get("http://utf8.api.smschinese.cn/?Uid=wangpo&Key=A9EAA9B87302694C886E3419C59F4FC6&smsMob=" + phoneNumber + "&smsText=" + smsText);
    }


}
